function XForms_data(params,childNodes){
  XForms_Core.call(this, params);
  this.childNodes = childNodes;
  for(var i=0,l=childNodes.length;i<l;i++){
    this.childNodes[i]._parent=this;
  }
  XForms.binds[this.getUID()]=this;
  this.toXml=function(res,relevant){
    if(typeof relevant=="undefined") relevant=false;
    var nodef=typeof res=="undefined";
    if(nodef) res=[];
    if(relevant && !this.isRelevant()) return;
    res.push("<",params._nodeName,">");
    //console.log(this.isRelevant());
    if(this.childNodes && this.childNodes.length>0) {
      for(var i=0,l=this.childNodes.length;i<l;i++){
        this.childNodes[i].toXml(res,relevant);
      }
    } else {
      res.push(this.getValue());
    }
    res.push("</",params._nodeName,">");
    if(nodef) return res.join("");
  }
  this.getValue=function(){
    return params.value;
  }
  this.resolveDependent=function(xform,events,expression){
    this.appendDependent(xform,events);
    for(var i=0,l=this.childNodes.length;i<l;i++){
      this.childNodes[i].resolveDependent(xform,events,expression);
    }
  }
  this.validate=function(validateError){
    if(typeof validateError=="undefined") validateError=[];
    for(var i=0,l=this.dependents.length;i<l;i++){
      if(this.dependents[i] instanceof XForms_bind){
        if(this.dependents[i].evalAttribute("required")){
          var val=this.getValue();
          if(typeof val=="undefined" || val===""){
            for(var j=0,k=this.dependents[i].dependents.length;j<k;j++){
              var $e=this.dependents[i].dependents[j].$element;
              if($e && $e.is(":visible")){
                validateError.push({name:params._nodeName,control:this.dependents[i].dependents[j]});
              }
            }
          } else {
            for(var j=0,k=this.dependents[i].dependents.length;j<k;j++){
              var $e=this.dependents[i].dependents[j].$element;
              if($e && $e.is(":visible")){
                var divs=$e.parents();
                if(
                    ($(divs[0]).find(".xforms_validationmessage:not(:empty())").length>0) ||
                    ($(divs[1]).find(".xforms_validationmessage:not(:empty())").length>0)) {
                  validateError.push({name:params._nodeName,control:this.dependents[i].dependents[j]});
                }
              }
            }
          }
        }
      }
    }
    if(this.childNodes && this.childNodes.length>0) {
      for(var i=0,l=this.childNodes.length;i<l;i++){
        this.childNodes[i].validate(validateError);
      }
    } else {
    }
    return validateError;
  }
  this.isRelevant=function(){
    var res=true;
    for(var i=0,l=this.dependents.length;i<l;i++){
      if(this.dependents[i] instanceof XForms_bind && (this.dependentsEvents[i].indexOf("xforms-value-changed")>-1)){
        if(!this.dependents[i].get("relevant")) {
          return true;
        }
        if(this.dependents[i].evalAttribute("relevant")){
          //console.log(params._nodeName,this.dependentsEvents[i]);
          //console.log(true, params._nodeName, this.dependents[i].get("relevant"));
          return true;
        } else {
          res=false;
        }
      }
    }
    return res;
  }
}
